import service from '@/utils/request'
import qs from 'qs'
// eslint-disable-next-line no-unused-vars
const { httpPostForm, httpPost, httpGet } = service

const request = {
    //======================================物资收入类提交===========================
    //签订提交
    findByIdsubmit (id) {
        return httpPostForm({
            url: '/subcontract/materialIncome/submitMaterialIncome',
            params: {
                billId: id,
            },
        })
    },
    //变更提交
    findByIdChangesubmit (id) {
        return httpPostForm({
            url: '/subcontract/materialAdj/submitMaterialIncomeAdj',
            params: {
                billId: id,
            },
        })
    },
    //======================================物资收入类保存===========================
    //签订保存
    saveMaterialIncome (params) {
        return httpPost({
            url: '/subcontract/materialIncome/saveMaterialIncome',
            params,
        })
    },
    //变更保存
    saveMaterialIncomeAdj (params) {
        return httpPost({
            url: '/subcontract/materialAdj/saveMaterialIncomeAdj',
            params,
        })
    },
    //======================================物资收入类删除===========================
    //签订逻辑删除
    findByIdDelete (id) {
        const params = qs.stringify({
            billId: id,
        })
        return httpPost({
            url: '/subcontract/materialIncome/deleteMaterialIncome',
            headers: {
                'Content-Type': 'application/x-www-form-urlencoded'
            },
            params,
        })
    },
    //变更逻辑删除
    findByIdChangeDelete (id) {
        const params = qs.stringify({
            billId: id,
        })
        return httpPost({
            url: '/subcontract/materialAdj/deleteMaterialIncomeAdj',
            headers: {
                'Content-Type': 'application/x-www-form-urlencoded'
            },
            params,
        })
    },
    //======================================物资销售查询===========================
    //物资销售基本信息查询
    findByIdBasic (id) {
        return httpGet({
            url: '/subcontract/materialSale/findMaterialSaleById',
            params: {
                billId: id,
            },
            headers: {
                'Content-Type': 'application/x-www-form-urlencoded'
            }
        })
    },
    //物资销售变更基本信息查询
    findByIdChangeBasic (id) {
        return httpGet({
            url: '/subcontract/materialAdj/findMaterialSalAdjById',
            params: {
                billId: id,
            },
            headers: {
                'Content-Type': 'application/x-www-form-urlencoded'
            }
        })
    },
    //=================================物资收入类变更查询=================================
    //变更历史查询
    findByIdchangeHistory (id) {
        return httpGet({
            url: '/subcontract/materialAdj/listAllMaterialIncomeAdj',
            params: {
                billId: id,
            },
            headers: {
                'Content-Type': 'application/x-www-form-urlencoded'
            }
        })
    },
    //=================================物资收入类创建变更=================================
    //变更创建
    createMaterialIncomeAdj (id) {
        return httpPostForm({
            url: '/subcontract/materialAdj/createMaterialIncomeAdj',
            params: {
                billId: id,
            },
        })
    },
    //======================================物资类 周材租赁查询===========================
    //周材租赁基本信息查询
    findMaterialLeaseOutById (id) {
        return httpGet({
            url: '/subcontract/materialLeaseOutController/findMaterialLeaseOutById',
            params: {
                billId: id,
            },
            headers: {
                'Content-Type': 'application/x-www-form-urlencoded'
            }
        })
    },
    //周材租赁变更基本信息查询
    findLeaseOutAdjById (id) {
        return httpGet({
            url: '/subcontract/materialAdj/findLeaseOutAdjById',
            params: {
                billId: id,
            },
            headers: {
                'Content-Type': 'application/x-www-form-urlencoded'
            }
        })
    },
    //======================================物资类 其他合同查询===========================
    //其他合同基本信息查询
    findMaterialOtherById (id) {
        return httpGet({
            url: '/subcontract/materialOther/findMaterialOtherById',
            params: {
                billId: id,
            },
            headers: {
                'Content-Type': 'application/x-www-form-urlencoded'
            }
        })
    },
    //其他合同变更基本信息查询
    findOtherAdjById (id) {
        return httpGet({
            url: '/subcontract/materialAdj/findOtherAdjById',
            params: {
                billId: id,
            },
            headers: {
                'Content-Type': 'application/x-www-form-urlencoded'
            }
        })
    },
}
export default request